package me.zk.practice1.hw;

import java.util.Arrays;
import java.util.Scanner;

public class HWBJJ23 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int total = scanner.nextInt();
        scanner.nextLine();
        int[] position = new int[total];
        for (int i = 0; i < total; i++) {
            position[i] = scanner.nextInt();
        }
        scanner.nextLine();
        int num = scanner.nextInt();
        Arrays.sort(position);
        int min = 1;
        int max = position[total-1] ;
        while (min <= max) {
            int mid = (max+min)/2;

            if (putTree(mid,position,num)){
                min = mid+1;
            } else {
                max = mid-1;
            }
        }
    System.out.println(max);
    }
    public static boolean putTree(int maxLen,int[] position,int total) {
        int current = position[0];
        int count = 1;
        for (int i = 1; i < position.length; i++) {
            if (position[i] - current >= maxLen) {
                current = position[i];
                count++;
            }
        }
        return count >= total;


    }
}
